//
//  TKYChangeStationHouseCell.m
//  StationHouseHelper
//
//  Created by apple on 2018/7/25.
//  Copyright © 2018年 铁科院. All rights reserved.
//

#import "TKYChangeStationHouseCell.h"
@interface TKYChangeStationHouseCell()

@property (nonatomic, strong)UIImageView *imageV;

@property (nonatomic, strong)UILabel *stationHouseNameLabel;
@end
@implementation TKYChangeStationHouseCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.imageV];
        [self.contentView addSubview:self.stationHouseNameLabel];
        
        [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).with.offset(kHeightScale *5);
            make.left.equalTo(self.contentView).with.offset(kWidthScale *20);
            make.bottom.equalTo(self.contentView).with.offset(-kWidthScale *5);
            make.width.mas_equalTo(50);
            make.height.mas_equalTo(50);
        }];
        
        [self.stationHouseNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).with.offset(self.kx_height/2 - kHeightScale *6);
            make.left.equalTo(self.imageV.mas_right).with.offset(kWidthScale *10);
            make.right.equalTo(self.contentView).with.offset(-kWidthScale *10);
            make.height.mas_equalTo(kHeightScale *20);
        }];
    }
    return self;
}

- (UIImageView *)imageV {
    if (_imageV == nil) {
        _imageV = [[UIImageView alloc]init];
        //_imageV.backgroundColor = KrandomColor;
        _imageV.image = [UIImage imageNamed:@"default"];
    }
    return _imageV;
}

- (UILabel *)stationHouseNameLabel{
    if (_stationHouseNameLabel == nil) {
        _stationHouseNameLabel = [[UILabel alloc]init];
        _stationHouseNameLabel.text = @"八达岭长城";
        _stationHouseNameLabel.textColor = kRGBColor(51, 51, 51, 1);
    }
    return _stationHouseNameLabel;
}

//数据赋值
- (void)setProjectInfoModel:(TKYProjectInfoModel *)projectInfoModel{
    _projectInfoModel = projectInfoModel;
    self.stationHouseNameLabel.text = projectInfoModel.projectName;
    self.imageV.image = [UIImage imageNamed:@"default"];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
